﻿using Newtonsoft.Json.Linq;

namespace Neo4jConnect.Traversal
{
    public class BuiltInReturnableEvaluator : ReturnableEvaluator
    {
        private readonly BuiltInReturnableEvaluatorType returnableEvaluatorType;

        public BuiltInReturnableEvaluator(BuiltInReturnableEvaluatorType returnableEvaluatorType)
        {
            this.returnableEvaluatorType = returnableEvaluatorType;
        }

        public override JToken ToJson()
        {
            dynamic obj = new JObject();
            obj.language = "builtin";
            obj.name = returnableEvaluatorType.GetDescription();
            return obj;
        }
    }
}
